<{include file='../common/view_header.tpl'}>
<div class="main_view">
	<div class="biaoge">   
        <div class="fudong1"><input type="button" class="button" value="观看扣分指标" onclick="show_koufen();"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" class="button" value="观看全部指标" onclick="show_all();"/></div>
	<h2 class="wjtit"><{$question_info.question_name}></h2>
	<p class="wjbh" style='text-align:left;'><label>问卷编号：</label><{$question_info.identifier}></p>
	<table width="100%" border="0" cellspacing="0">
	  <tr>
		<td>网点名称：</td>
		<td><span class="wjbh"><{$netquestion_info.network_name}></span></td>
		<td>网点编号：<br /></td>
		<td><span class="wjbh"><{$network_info.network_num}></span></td>
		<{if $up_network_info}>
                <td>所属分行：</td>
		<td><span class="wjbh"><{$up_network_info.network_name}></span></td>
		<td>分行编号：</td>
		<td><span class="wjbh"><{$up_network_info.network_num}></span></td>
                <{/if}>
	  </tr>
	 <{if $basic_list}>
          <{foreach $basic_list as $key => $val}>
	  <tr>
		<td colspan="2"><{$val.title}>:</td>
		<td colspan="6"><span class="wjbh"><{$answer_list[$val.subject_id].answer_desc}></span></td>
	  </tr>
          <{/foreach}>
          <{/if}>
	</table>
        <{foreach $classify_list['list'][1] as $parent_key => $parent_val}>
           <!--一级--> 
        <{if $parent_val}>
        <p class="wjbh pt10"><label><strong><{$classify_list['all'][$parent_val]}></strong></label></p>
        <{/if}>
        
        <!--是否有二级-->
        <{foreach $classify_list['list'][2] as $second_key => $second_val}>
            <{if $second_val|in_array:$classify_list['parent'][$parent_val]}>
            <p class="wjbh pt10"><label><strong><{$classify_list['all'][$second_val]}></strong></label></p>
            <{/if}>
            <{foreach $classify_list['list'][3] as $classify_key => $classify_val}>
            <{if $classify_val|in_array:$classify_list['parent'][$second_val]}>
        <div class="group" id="<{$classify_val}>" style="display:none;">
	<p class="wjbh pt10"><label><strong><{$classify_list['all'][$classify_val]}></strong></label></p>
	<table width="100%" border="0" cellspacing="0">
	  <tr>
		<td width="50%"><strong>指标</strong></td>
		<td width="5%"><strong>标准分</strong></td>
                <td width="4%"><strong>得分</strong></td>
                <td width="5%"><strong>选项</strong></td>
                <td width="5%"><strong>选项值</strong></td>
		<td width="15%"><strong>情景描述</strong></td>
                <td width="4%"><strong>附件</strong></td>
                <td width="7%"><strong>操作</strong></td>
	  </tr>
        <{if $subject_list[$classify_val]}>
          <{foreach $subject_list[$classify_val] as $subject_key => $subject_val}>
            <!--只显示扣分的-->
	  <tr class="classify_<{$classify_val}>" data="<{if isset($answer_list[$subject_val.subject_id])&&($subject_val.standard_score!=$answer_list[$subject_val.subject_id].answer_score)}>show<{else}>hide<{/if}>">
		<td><p><{$subject_val.question_num}> <{$subject_val.title}></p><p><{$subject_val.content}></p></td>
		<td><{$subject_val.standard_score}></td>
                <td><span class="wjbh"><{$answer_list[$subject_val.subject_id].answer_score}></span></td>
                <td>
                    <{if isset($option_list[$subject_val.subject_id])}>
                    <{foreach $option_list[$subject_val.subject_id] as $option_key => $option_val}>
                        <{$option_key}>：<{$option_val}><br/>
                    <{/foreach}>
                    <{/if}>
                </td>
                <td><{if isset($answer_list[$subject_val.subject_id])}><{$answer_list[$subject_val.subject_id].answer_option}><{/if}></td>
		<td><{if isset($answer_list[$subject_val.subject_id])}><{$answer_list[$subject_val.subject_id].answer_desc}><{/if}></td>
                <td>
                    <{if isset($attach_list[$subject_val.subject_id])}>
                    <a href="/webadmin/netQuestion/attach?nq_id=<{$nq_id}>&subject_id=<{$subject_val.subject_id}>" target="_blank">附件</a>
                    <{/if}>
                </td>
                <td>
                    <{if $benchmark_list[$subject_val.subject_id]}><a href="javascript:;" onclick="history(<{$netquestion_info.nq_id}>,<{$subject_val.subject_id}>);">对标历史</a><{/if}>   
                </td>
	  </tr>
            <{/foreach}>
          <{/if}>
	</table>
        </div>
        <{/if}>
        <{/foreach}>
        <{/foreach}>
        <{/foreach}>
	</table>		
  </div>
</div>
<script>
$(function(){
    //判断分组下是否有扣分项，如果没有将此分组隐藏,默认只显示扣分指标
    show_koufen();
})

//显示所有指标
function show_all(){
    $('.group').each(function(i){
        var classify_id = $(this).attr('id');
        //每个分类下问题处理
        $('.classify_'+classify_id).each(function(i){
                $(this).show();
        })
        $(this).show();
    });
}
//只显示扣分指标
function show_koufen(){
    $('.group').hide();
    $('.group').each(function(i){
        var classify_show = false;
        var classify_id = $(this).attr('id');
        //每个分类下问题处理
        $('.classify_'+classify_id).each(function(i){
            var data = $(this).attr('data');
            if (data == 'hide') {
                $(this).hide();
            }
            //如果有show状态的，这个classify就显示,默认不显示
            if (data == 'show') {
                classify_show = true;
            }
        })
        if (classify_show) {
            $(this).show();
        }
    });
}

//对标的历史
//以及管理员对对标历史的操作历史
function history(nq_id, subject_id){
    $.layer({
        type: 2, 
        title: '网点对标历史记录',
        border:[10, 0.3, '#000'],
        closeBtn:[0, true],
        shade: [0.5, '#000'],
        offset: ['100px', ''],
        area: ['800px', '450px'],
        iframe: {src: '/webadmin/netQuestion/history?nq_id='+nq_id+'&subject_id='+subject_id}
     });
}
</script>
</script>
<{include file="../common/footer.tpl"}>